/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package logica;

import javax.swing.JOptionPane;
import javax.swing.JTextField;

/**
 *
 * @author Elias Mendoza
 */
public class gestion {

  protected boolean camposVacios(JTextField[] campos) {
    for (int i = 0; i < campos.length; i++) {
      if (campos[i].getText().isEmpty()) {
        JOptionPane.showMessageDialog(null, "Fallo el registro, campos vacios", "error al registrar", JOptionPane.ERROR_MESSAGE);
        return true;
      }
    }
    return false;
  }

  protected void vaciarCampos(JTextField[] campos) {
    for (int i = 0; i < campos.length; i++) {
      campos[i].setText("");
    }
  }
}
